import { thisPinia } from '@/pinia/index';
const themeList = [
    { color: ['#FDF9EA', '#800000'] },
    { color: ['#D7B9A1', '#0D7E9E'] },
    { color: ['#FFCD06', '#022A9B'] },
]
const ThemeChange = (distinguish) => {
    const { theme_index, token } = thisPinia()
    // distinguish -预留主题下表-可接受传参替换(theme_index == 2 ? 0 : theme_index + 1)
    const _index = distinguish == '*'
        ? (theme_index == (themeList.length - 1) ? 0 : theme_index + 1)
        : (token == '' ? 0 : theme_index)
    // 获取存储
    const { color } = themeList[_index]
    for (let i in color) {
        document.documentElement.style.setProperty(`--theme-color${Number(i) + 1}`, color[i]);
    }
    thisPinia()._theme(_index)
}
export default ThemeChange